import 'package:flutter/material.dart';
import 'package:flutter_base_widget/base/base.dart';

class DismissableScreen extends BasePage {
  @override
  Widget rebuild(BuildContext context) {
    return Container(
      child: ListView.builder(
        itemCount: 20,
        itemBuilder: (context,index){
          return Dismissible(
            key: Key("$index"),
            background: Container(
              color: Colors.green,
              alignment: Alignment.centerLeft,
              child: Icon(Icons.delete),
            ),
            secondaryBackground: Container(
              color: Colors.red,
              alignment: Alignment.centerRight,
              child: Icon(Icons.check),
            ),
            child: Padding(
              padding: const EdgeInsets.all(20),
              child: Text("---$index"),
            ),
          );
        },
      ),
    );
  }
}